<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    div {
      width: 300px;
      height: 200px;
      background: #000;
      position: relative;
    }

    
    div::after, div::before {
      content: "";
      position: absolute;
      top: 10px;
      bottom: 10px;
      right: 10px;
      left: 10px;
      opacity: 0;
      transition: all .5s;
    }

    div::after {
      border-top: 1px solid #fff;
      border-bottom: 1px solid #fff;
      transform: scale(0, 1);
    }

    div::before {
      border-left: 1px solid #fff;
      border-right: 1px solid #fff;
      transform: scale(1, 0);
    }

    div:hover::after, div:hover::before {
      transform: scale(1);
      opacity: 1;
    }
    
  </style>
</head>
<body>
  <div></div>
</body>
</html>